package com.ruoyi.receipt.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.receipt.mapper.TbUserRelationMapper;
import com.ruoyi.receipt.domain.TbUserRelation;
import com.ruoyi.receipt.service.ITbUserRelationService;

/**
 * 用户关系Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-03-30
 */
@Service
public class TbUserRelationServiceImpl implements ITbUserRelationService 
{
    @Autowired
    private TbUserRelationMapper tbUserRelationMapper;

    /**
     * 查询用户关系
     * 
     * @param id 用户关系ID
     * @return 用户关系
     */
    @Override
    public TbUserRelation selectTbUserRelationById(Long id)
    {
        return tbUserRelationMapper.selectTbUserRelationById(id);
    }

    /**
     * 查询用户关系列表
     * 
     * @param tbUserRelation 用户关系
     * @return 用户关系
     */
    @Override
    public List<TbUserRelation> selectTbUserRelationList(TbUserRelation tbUserRelation)
    {
        return tbUserRelationMapper.selectTbUserRelationList(tbUserRelation);
    }

    /**
     * 新增用户关系
     * 
     * @param tbUserRelation 用户关系
     * @return 结果
     */
    @Override
    public int insertTbUserRelation(TbUserRelation tbUserRelation)
    {
        tbUserRelation.setCreateTime(DateUtils.getNowDate());
        return tbUserRelationMapper.insertTbUserRelation(tbUserRelation);
    }

    /**
     * 修改用户关系
     * 
     * @param tbUserRelation 用户关系
     * @return 结果
     */
    @Override
    public int updateTbUserRelation(TbUserRelation tbUserRelation)
    {
        tbUserRelation.setUpdateTime(DateUtils.getNowDate());
        return tbUserRelationMapper.updateTbUserRelation(tbUserRelation);
    }

    /**
     * 批量删除用户关系
     * 
     * @param ids 需要删除的用户关系ID
     * @return 结果
     */
    @Override
    public int deleteTbUserRelationByIds(Long[] ids)
    {
        return tbUserRelationMapper.deleteTbUserRelationByIds(ids);
    }

    /**
     * 删除用户关系信息
     * 
     * @param id 用户关系ID
     * @return 结果
     */
    @Override
    public int deleteTbUserRelationById(Long id)
    {
        return tbUserRelationMapper.deleteTbUserRelationById(id);
    }
}
